﻿//NSA3000THD.h

#ifndef NSA3000THD_H_
#define NSA3000THD_H_

#if defined(NSA3000THD_LIBRARY)
#  define NSA3000THD_EXPORT Q_DECL_EXPORT
#else
#  define NSA3000THD_EXPORT Q_DECL_IMPORT
#endif
#include "sys_h/DATATYPE.h"
#include "NET_ORDER_NUM.h"

#pragma once

class NSA3000TRD;
class NSA3000TDB;
class NSA3000TNM;
class NSA3000TSS;

class NSA3000THD_EXPORT NSA3000THD
{
public:
	NSA3000THD();
	~NSA3000THD();
	//��ʼ��
	int  Init(NSA3000TRD *pRealDB, NSA3000TNM *pNM,NSA3000TSS *pSS, XINT ProcId);

	//������ʷ���� ���˽ṹ��Import_His_Data����д,ֻ��Ҫ��д���±���
	//Import_His_Data.DeviceId
	//				 .TableId
	//	             .StartTime_t(��ѯ��ʼʱ��time_t)
	//				 .EndTime_t (��ѯ����ʱ��time_t)
	//Buff_len:��󳤶�Ϊ1024
	//bWaitFlag:�Ƿ���ʾ�ȴ��Ի���
	//MaxWaitTime_S���ȴ��ʱ�����õ�λ��S��
	//���أ�0����ʾ����Ҫ���� 1����ʾ����Ҫ���������
	int  ImportHisData(XCHAR *CmdBuff, XINT Buff_len, XINT CmdNum, XBOOL8 bWaitFlag, XUINT MaxWaitTime_S);

	//�����ʷ���ݻص��Ի���
	int  StartImportHDataDlg(void *pParent=NULL);

	//�ͷź���
	void Finish();

protected:
	//	�ر����ݹ����߳�
	void	CloseThread(XBOOL8 bExit);

	//����Ƿ���Ҫ����
	XBOOL8	CheckNeedImport(Import_His_Data ImportCmd);
	XBOOL8	CheckTimeIsNeedImport(XUINT LastStarttime,XUINT LastEndtime,XUINT curStartTime,XUINT CurEndTime);

};



//////////////////////////////////////////////////////////////////////////
#endif